package entity;

import java.io.Serializable;
import java.util.List;

/**
 * Pages
 *
 * @author lenovo
 * @since 2023/8/25
 */
public class Pages<T> implements Serializable {
    private static final long serialVersionUID = 42L;

    //页面大小
    private int pageSize;

    //当前页码
    private int pageCountNo;

    //总数据
    private int pageCount;

    //总页数
    private int pageTotal;

    private List<T> list;

    public Pages() {
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageCountNo() {
        return pageCountNo;
    }

    public void setPageCountNo(int pageCountNo) {
        this.pageCountNo = pageCountNo;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
        this.pageTotal = pageCount % pageSize == 0 ? pageCount / pageSize : pageCount / pageSize + 1;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
